<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Proposal extends CI_Controller {

	function __construct()
	{
		parent::__construct();
		
		// check if user logged in 
		if (!$this->ion_auth->logged_in())
	  	{
			redirect('auth/login');
	  	}		
		 $this->load->model('user/caller/proposal_model');			
	}
	
	
   function index()
   {
	 $meta['page_title'] = "Proposal";
	
	 $data['modules'] = $this->proposal_model->get_all_modules(); 
     $this->load->view('common/header', $meta);
     $this->load->view('user/caller/proposal',$data);
     $this->load->view('common/footer');
   }
   
   function create_module()
   {
	   $insert = array(
	   'name' => $_REQUEST['module_name'],
   	   'description' => $_REQUEST['module_desc'],
   	   'price' => $_REQUEST['module_price'],
   	   'type' => $_REQUEST['module_type'],	   
	   );
	   
	  // print_r();
	   $this->proposal_model->create_module($insert);
	   
	   
   }
   
   //feature
   
    function create_feature()
   {
	   $insert = array(
	   'name' => $_REQUEST['feature_name'],
   	   'description' => $_REQUEST['feature_desc'],
   	   'price' => $_REQUEST['feature_price'],
   	   'module_id' => $_REQUEST['feature_type'],	   
	   );
	   
	  // print_r($insert);
	//  exit;
	   $this->proposal_model->create_feature($insert);
	   
	   
   }
   
}
	
	?>